
import java.awt.Color;
import javax.swing.JButton;

/**
 * 
 * @author Lars, Jacob
 *
 */

public class KalenderKnap extends JButton
{
	private static final long serialVersionUID = 1L;
	private Color defaultBG;
	
	private boolean selected = false;
	private int number;
	
	public KalenderKnap(int number, Color bgColor)
	{
		super("" + number);
		this.number = number;
		this.defaultBG = bgColor;
		
		setBackground(bgColor);
	}
	
	public boolean isSelected()
	{
		return selected;
	}
	
	public void setSelected(boolean value)
	{
		if (value)
		{
			setBackground(Color.BLUE);
			setForeground(Color.WHITE);
		}
		
		else
		{
			setBackground(defaultBG);
			setForeground(Color.BLACK);
		}
		
		selected = value;
	}
	
	public int getNumber()
	{
		return number;
	}

}
